/*
 * acm1205.c
 *
 *  Created on: 20 Mar 2010
 *      Author: xuxu
 */

#include<stdio.h>
#include<string.h>
#include<stdlib.h>

int chartoint(char c)
{
	int ret;
	if (c > '9')
	{
		ret = 10 + c - 'a';
	}
	else
	{
		ret = c - '0';
	}
	return ret;
}

char inttochar(int n)
{
	char ret;
	if (n > 9)
	{
		ret = n - 10 + 'a';
	}
	else
	{
		ret = n + '0';
	}
	return ret;
}

int main()
{
	char num1[110],num2[110];
	char result[110];
	int jw, len1, len2, lenr;
	int x, y;
	int i;
	while(scanf("%s%s",num1,num2)!=EOF)
	{
		memset(result, 0, sizeof(result));
		len1 = strlen(num1) - 1;
		len2 = strlen(num2) - 1;
		lenr = 0;
		jw = 0;
		while (len1 >= 0 && len2 >= 0)
		{
			x = chartoint(num1[len1]);
			y = chartoint(num2[len2]);
			result[lenr++] = inttochar((x + y + jw) % 20);
			jw = (x + y + jw) / 20;
			len1--;
			len2--;
		}
		while (len1 >= 0)
		{
			x = chartoint(num1[len1]);
			result[lenr++] = inttochar((x + jw) % 20);
			jw = (x + jw) / 20;
			len1--;
		}
		while (len2 >= 0)
		{
			y = chartoint(num2[len2]);
			result[lenr++] = inttochar((y + jw) % 20);
			jw = (y + jw) / 20;
			len2--;
		}
		if (jw)
			result[lenr++] = '1';
		for (i = lenr - 1; i >= 0; i--)
			printf("%c", result[i]);
		printf("\n");
	}
	return 0;
}
